package com.co.ud.icehome.test;

import org.mule.RequestContext;
import org.mule.api.MuleEvent;
import org.mule.api.MuleMessage;

public class ConnectionDNS{

	private String address = "localhost";
	private String port = "8085";
	private MuleEvent event;

	public MuleMessage recoveryAddress(UserString user) {

		event = RequestContext.getEvent();
		MuleMessage message = event.getMessage();
		if (user != null) {

			message.setOutboundProperty("host", address);
			message.setOutboundProperty("port", port);
			message.setOutboundProperty("path", "measure/?dim=3");
			message.setPayload(user);
			// get hostname from username

			// get ip from hostname

			// config user

			// response="el dispositivo se encuentra en la direccion: "+this.address+":"+this.port;

		} else {
			message = null;
			// response="No existe dispositivo";
		}

		return message;
	}


}
